<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>工资想过万，键盘要敲烂</title>
    <style></style>
  </head>

  <body>
    <script>
      let str = '今天起的有点早'

      str = str.replace('今', '<span style="color: red">今</span>')
      console.log(str)

      str = str.replace(/今/g, '<span style="color: red">今</span>')

      document.body.innerHTML = str
    </script>
  </body>
</html>
